<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>02html方法和text方法</title>
</head>
<body>
    
    <div><h3>我是标题</h3></div>

    <script src="../jquery-3.2.1.js"></script>
    <script>
        
        $(function(){
            // html:innerHTML  text:innerText

            // console.log($("div").html());
            // console.log($("div").text());
            $("div").html("<p>我是文本</p>")
            $("div").text("<p>我是文本</p>")
        })

    </script>
</body>
</html>